package com.george.es;

import com.george.es.util.IdWorker;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * <p>
 *  程序入口
 * </p>
 *
 * @author GeorgeChan 2019/6/13 11:48
 * @version 1.0
 * @since jdk1.8
 */
@SpringBootApplication
@EnableTransactionManagement // 支持事务管理
@MapperScan("com.george.*.dao") /* dao的扫描范围 */
public class    ElasticSearchApplication {
    protected final static Logger LOGGER = LoggerFactory.getLogger(ElasticSearchApplication.class);

    public static void main(String[] args) {
        SpringApplication.run(ElasticSearchApplication.class, args);
        LOGGER.info("启动成功......");
    }

    /**
     * 注入id生成器
     * @return IdWorker
     */
    @Bean
    public IdWorker idWorkker(){
        return new IdWorker();
    }
}
